package com.heima.article.task;

import com.heima.article.service.IHotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ArticleTasks {

    @Autowired
    IHotArticleService hotArticleService;

    @XxlJob("computerHotArticleJob")
    public ReturnT<String> computerHotArticleJob (String param) throws Exception {
        System.out.println("开始执行任务调度..." + new Date());
        hotArticleService.compute();
        return ReturnT.SUCCESS;
    }
}
